﻿using QFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Tilemaps;
using UnityEngine.UIElements;

namespace projectgame
{
    public class ToolShovel : ITool
    {
        public string Name { get; set; } = "shovel";

        public bool Selectable(ToolData toolData)
        {
            return toolData.ShowGrid[toolData.CellPos.x, toolData.CellPos.y] == null;
        }

        public void Use(ToolData toolData)
        {
            toolData.SoilTilemap.SetTile(toolData.CellPos,toolData.Pen);
            toolData.ShowGrid[toolData.CellPos.x, toolData.CellPos.y] = new SoilData();
            AudioController.Get.SfxShovelDig.Play();
        }
    }
}
